<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('成绩列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>类别：</label>
                                <input type="text" name="leibie"/>
                            </li>
                            <li>
                                <label>速度：</label>
                                <input type="text" name="speed"/>
                            </li>
                            <li>
                                <label>准确率：</label>
                                <input type="text" name="accuracy"/>
                            </li>
                            <li>
                                <label>退格：</label>
                                <input type="text" name="backspace"/>
                            </li>
                            <li>
                                <label>成绩：</label>
                                <input type="text" name="score"/>
                            </li>
                            <li>
                                <label>年级：</label>
                                <input type="text" name="nianji"/>
                            </li>
                            <li>
                                <label>班级：</label>
                                <input type="text" name="banji"/>
                            </li>
                            <li>
                                <label>姓名：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>文章ID：</label>
                                <input type="text" name="articleId"/>
                            </li>
                            <li>
                                <label>文章标题：</label>
                                <input type="text" name="title"/>
                            </li>
                            <li>
                                <label>创建时间：</label>
                                <input type="text" class="time-input" placeholder="请选择创建时间" name="createdTime"/>
                            </li>
                            <li>
                                <label>测试时间：</label>
                                <input type="text" name="testTime"/>
                            </li>
                            <li>
                                <label>模式：</label>
                                <input type="text" name="model"/>
                            </li>
                            <li>
                                <label>考试ID：</label>
                                <input type="text" name="examId"/>
                            </li>
                            <li>
                                <label>考试名称：</label>
                                <input type="text" name="examName"/>
                            </li>
                            <li>
                                <label>教育局：</label>
                                <input type="text" name="jiaoyujuId"/>
                            </li>
                            <li>
                                <label>集团校：</label>
                                <input type="text" name="jituanxiaoId"/>
                            </li>
                            <li>
                                <label>学校：</label>
                                <input type="text" name="schoolId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="typing:score:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="typing:score:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="typing:score:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="typing:score:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('typing:score:edit')}]];
        var removeFlag = [[${@permission.hasPermi('typing:score:remove')}]];
        var prefix = ctx + "typing/score";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "成绩",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'scoreId',
                    title: '成绩ID',
                    visible: false
                },
                {
                    field: 'leibie',
                    title: '类别'
                },
                {
                    field: 'speed',
                    title: '速度'
                },
                {
                    field: 'accuracy',
                    title: '准确率'
                },
                {
                    field: 'backspace',
                    title: '退格'
                },
                {
                    field: 'score',
                    title: '成绩'
                },
                {
                    field: 'nianji',
                    title: '年级'
                },
                {
                    field: 'banji',
                    title: '班级'
                },
                {
                    field: 'name',
                    title: '姓名'
                },
                {
                    field: 'articleId',
                    title: '文章ID'
                },
                {
                    field: 'title',
                    title: '文章标题'
                },
                {
                    field: 'createdTime',
                    title: '创建时间'
                },
                {
                    field: 'testTime',
                    title: '测试时间'
                },
                {
                    field: 'model',
                    title: '模式'
                },
                {
                    field: 'examId',
                    title: '考试ID'
                },
                {
                    field: 'examName',
                    title: '考试名称'
                },
                {
                    field: 'jiaoyuju.deptName',
                    title: '教育局'
                },
                {
                    field: 'jituanxiao.deptName',
                    title: '集团校'
                },
                {
                    field: 'school.deptName',
                    title: '学校'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.scoreId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.scoreId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>